::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: pink;
}
::-moz-placeholder { /* Firefox 19+ */
color: pink;
}
:-ms-input-placeholder { /* IE 10+ */
color: pink;
}
:-moz-placeholder { /* Firefox 18- */
color: pink;
}
input {
border: 1px solid black;
padding: 3px;
height: 20px;
}
input:placeholder-shown {
border-color: teal;
color: purple;
font-style: italic;
}
<form>
<input type="text" id="name" name="name" required="required" />
<label for="name">Name</label>
<br/>
<input type="email" id="email" name="email" placeholder="Email" required="required" />
<br/>
<input type="submit" />
</form>
Run code snippetHide results